/*User program on Nachos
  For project 4
*/

/*Author: Yuzhe Wu 4/14*/


#include "syscall.h"
#include "user.h"
#include "create.h"
#include "doctorOffice.h"

void main() {

	int docNumLocal;
	int i = 0;
	myMV docNum = -1;
	Printf("Please enter the number of Doctors(1 to 3)\n");
	docNumLocal = InputInt();
	while ( !(docNumLocal >=1&&docNumLocal <=3)){
		Printf("You must input an Integer(1 to 3)\n");
		Printf("Please reenter the number of Doctors(1 to 3)\n");
		docNumLocal = InputInt();					
	}
	
	docNum = rpcCreateMV("docNum",sizeof("docNum"),1,0);
	rpcSetValueMV(docNum,0,docNumLocal);
	
	for(i=0; i < docNumLocal; i++){
		Exec("../test/doctor",sizeof("../test/doctor"));
		delay();
	}
	Exit(0);

}